class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: D = None
        self.txt = txt

f = A("f")
h = B("h")
e = C("e")
b = D("b")
a = E("a")
i = F("i")
j = G("j")
k = B("k")
m = B("m")

f.r = b
h.q = a
h.z = a
e.v = a
e.z = a
e.y = a
e.u = h
b.s = f
b.v = f
b.p = f
b.y = f
b.t = m
b.u = e
a.t = j
i.x = j
i.o = b
j.o = i
j.x = b
k.q = a
k.z = a
m.q = a
m.z = a
assert e.u.q.t.o.o.t.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: D = None
        self.txt = txt

f = A("f")
h = B("h")
e = C("e")
b = D("b")
a = E("a")
i = F("i")
j = G("j")
k = B("k")
m = B("m")

f.r = b
h.q = a
h.z = a
e.v = a
e.z = a
e.y = a
e.u = h
b.s = f
b.v = f
b.p = f
b.y = f
b.t = m
b.u = e
a.t = j
i.x = j
i.o = b
j.o = i
j.x = b
k.q = a
k.z = a
m.q = a
m.z = a
assert e.u.q.t.o.o.t.z.t.txt == "j"