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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

j.u = g
j.y = g
j.r = a
c.o = g
c.w = a
c.u = j
a.t = d
a.r = d
a.x = c
a.o = g
d.s = b
g.t = j
g.s = j
g.r = c
g.u = d
b.p = g
b.t = d
assert a.x.o.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

j.u = g
j.y = g
j.r = a
c.o = g
c.w = a
c.u = j
a.t = d
a.r = d
a.x = c
a.o = g
d.s = b
g.t = j
g.s = j
g.r = c
g.u = d
b.p = g
b.t = d
assert a.x.o.t.r.txt == "a"