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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: C = None
        self.y: E = None
        self.q: F = None
        self.r: D = None
        self.t: E = None
        self.v: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: C = None
        self.y: E = None
        self.q: F = None
        self.r: D = None
        self.t: E = None
        self.v: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

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

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