class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

j = A("j")
b = B("b")
a = C("a")
n = D("n")
e = E("e")
c = F("c")
k = F("k")
g = C("g")
h = A("h")

j.v = c
j.w = a
b.r = n
b.x = n
b.w = n
b.s = g
b.u = e
a.x = c
n.z = b
e.w = b
e.r = a
e.x = a
e.p = k
c.r = b
c.x = n
c.p = n
c.u = n
c.y = n
c.z = g
k.r = b
k.x = n
k.p = n
k.u = n
k.y = n
k.z = a
g.x = k
h.v = k
h.w = g
assert k.r.u.x.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

j = A("j")
b = B("b")
a = C("a")
n = D("n")
e = E("e")
c = F("c")
k = F("k")
g = C("g")
h = A("h")

j.v = c
j.w = a
b.r = n
b.x = n
b.w = n
b.s = g
b.u = e
a.x = c
n.z = b
e.w = b
e.r = a
e.x = a
e.p = k
c.r = b
c.x = n
c.p = n
c.u = n
c.y = n
c.z = g
k.r = b
k.x = n
k.p = n
k.u = n
k.y = n
k.z = a
g.x = k
h.v = k
h.w = g
assert k.r.u.x.x.r.txt == "b"