class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: E = None
        self.v: F = None
        self.t: B = None
        self.o: F = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: A = None
        self.t: B = None
        self.p: F = None
        self.x: E = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.z: F = None
        self.r: B = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

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

f = A("f")
k = B("k")
g = C("g")
h = D("h")
c = E("c")
j = F("j")

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: A = None
        self.t: B = None
        self.p: F = None
        self.x: E = None
        self.z: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.z: F = None
        self.r: B = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

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

f = A("f")
k = B("k")
g = C("g")
h = D("h")
c = E("c")
j = F("j")

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