class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: B = None
        self.t: B = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.u: F = None
        self.y: F = None
        self.s: G = None
        self.t: B = None
        self.txt = txt

h = A("h")
c = B("c")
l = C("l")
a = D("a")
m = E("m")
n = F("n")
j = G("j")
k = G("k")
d = A("d")
b = B("b")

h.o = k
c.r = n
c.w = n
l.u = k
l.p = b
a.q = l
a.u = b
a.s = n
m.u = n
n.q = a
n.u = a
n.o = b
n.t = c
j.w = h
j.v = a
j.u = n
j.y = n
j.s = k
j.t = b
k.w = d
k.v = a
k.u = n
k.y = n
k.s = j
k.t = c
d.o = j
b.r = n
b.w = n
assert j.t.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: B = None
        self.t: B = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.u: F = None
        self.y: F = None
        self.s: G = None
        self.t: B = None
        self.txt = txt

h = A("h")
c = B("c")
l = C("l")
a = D("a")
m = E("m")
n = F("n")
j = G("j")
k = G("k")
d = A("d")
b = B("b")

h.o = k
c.r = n
c.w = n
l.u = k
l.p = b
a.q = l
a.u = b
a.s = n
m.u = n
n.q = a
n.u = a
n.o = b
n.t = c
j.w = h
j.v = a
j.u = n
j.y = n
j.s = k
j.t = b
k.w = d
k.v = a
k.u = n
k.y = n
k.s = j
k.t = c
d.o = j
b.r = n
b.w = n
assert j.t.r.u.txt == "a"