class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: D = None
        self.u: G = None
        self.r: G = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.t: B = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

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

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

h = A("h")
c = B("c")
j = C("j")
e = D("e")
a = E("a")
m = F("m")
l = G("l")
f = E("f")

h.x = j
h.y = e
h.z = e
h.u = l
h.r = l
c.x = l
c.v = h
c.y = a
j.x = h
e.q = f
e.z = h
a.z = c
a.t = c
a.w = c
a.r = j
a.u = h
m.q = j
l.t = j
f.z = c
f.t = c
f.w = c
f.r = j
f.u = h
assert c.v.x.x.z.z.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: D = None
        self.u: G = None
        self.r: G = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.t: B = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

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

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

h = A("h")
c = B("c")
j = C("j")
e = D("e")
a = E("a")
m = F("m")
l = G("l")
f = E("f")

h.x = j
h.y = e
h.z = e
h.u = l
h.r = l
c.x = l
c.v = h
c.y = a
j.x = h
e.q = f
e.z = h
a.z = c
a.t = c
a.w = c
a.r = j
a.u = h
m.q = j
l.t = j
f.z = c
f.t = c
f.w = c
f.r = j
f.u = h
assert c.v.x.x.z.z.u.t.txt == "j"