class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

n.t = j
n.y = j
n.s = f
h.p = f
h.u = f
h.o = c
b.r = f
b.s = a
b.w = a
a.q = c
a.r = j
c.p = b
c.o = a
c.z = a
c.t = h
f.v = n
j.t = n
j.y = n
j.s = f
assert f.v.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

n.t = j
n.y = j
n.s = f
h.p = f
h.u = f
h.o = c
b.r = f
b.s = a
b.w = a
a.q = c
a.r = j
c.p = b
c.o = a
c.z = a
c.t = h
f.v = n
j.t = n
j.y = n
j.s = f
assert f.v.s.v.txt == "n"