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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: G = None
        self.y: D = None
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.o: B = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: G = None
        self.y: D = None
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.o: B = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

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

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