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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.y: A = None
        self.q: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.t: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.y: A = None
        self.q: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.t: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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