class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: E = None
        self.u: D = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: E = None
        self.z: E = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

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

c = A("c")
b = B("b")
g = C("g")
f = D("f")
k = E("k")
e = F("e")
n = G("n")
m = E("m")
d = D("d")
j = B("j")

c.q = n
c.z = j
b.x = n
b.o = c
b.v = c
g.x = f
g.s = m
g.o = m
g.u = d
g.w = k
f.y = e
f.q = g
k.r = e
e.o = g
e.t = g
e.y = m
e.z = m
e.x = m
n.t = c
m.r = e
d.y = e
d.q = g
j.x = n
j.o = c
j.v = c
assert k.r.t.x.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: E = None
        self.u: D = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: E = None
        self.z: E = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

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

c = A("c")
b = B("b")
g = C("g")
f = D("f")
k = E("k")
e = F("e")
n = G("n")
m = E("m")
d = D("d")
j = B("j")

c.q = n
c.z = j
b.x = n
b.o = c
b.v = c
g.x = f
g.s = m
g.o = m
g.u = d
g.w = k
f.y = e
f.q = g
k.r = e
e.o = g
e.t = g
e.y = m
e.z = m
e.x = m
n.t = c
m.r = e
d.y = e
d.q = g
j.x = n
j.o = c
j.v = c
assert k.r.t.x.q.u.txt == "d"