class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: C = None
        self.s: B = None
        self.p: C = None
        self.r: G = None
        self.o: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: C = None
        self.o: D = None
        self.z: B = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: C = None
        self.o: D = None
        self.z: B = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

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