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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: A = None
        self.v: A = None
        self.s: A = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: A = None
        self.t: C = None
        self.v: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: C = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: A = None
        self.v: A = None
        self.s: A = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: A = None
        self.t: C = None
        self.v: B = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: C = None
        self.u: A = None
        self.v: D = None
        self.txt = txt

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

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

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