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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: A = None
        self.t: E = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

b.o = n
b.p = n
b.w = c
b.x = c
b.y = g
c.w = g
c.q = b
c.r = b
c.t = m
j.x = m
j.q = n
j.u = b
g.o = m
m.x = j
m.o = n
m.u = c
a.v = b
a.q = b
a.o = g
a.u = g
n.x = m
n.q = j
n.u = b
assert n.x.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.y: D = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: A = None
        self.t: E = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

b.o = n
b.p = n
b.w = c
b.x = c
b.y = g
c.w = g
c.q = b
c.r = b
c.t = m
j.x = m
j.q = n
j.u = b
g.o = m
m.x = j
m.o = n
m.u = c
a.v = b
a.q = b
a.o = g
a.u = g
n.x = m
n.q = j
n.u = b
assert n.x.u.r.txt == "b"