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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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