class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.r: D = None
        self.s: D = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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