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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: A = None
        self.s: E = None
        self.p: E = None
        self.q: A = None
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: A = None
        self.s: E = None
        self.p: E = None
        self.q: A = None
        self.u: B = None
        self.txt = txt

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

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

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