class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: C = None
        self.p: C = None
        self.t: F = None
        self.o: C = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: E = None
        self.s: D = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.u: F = None
        self.o: C = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

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

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

b = A("b")
h = B("h")
f = C("f")
l = D("l")
g = E("g")
i = F("i")

b.t = l
b.u = f
h.x = i
h.t = i
h.v = f
h.p = f
h.o = f
h.r = b
f.v = i
f.u = g
f.y = g
f.s = l
f.q = l
l.p = b
l.r = i
l.u = i
l.y = i
l.v = i
l.o = f
g.u = i
g.o = l
g.x = f
g.w = h
i.s = b
i.p = h
i.t = h
i.o = g
assert f.v.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: C = None
        self.p: C = None
        self.t: F = None
        self.o: C = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: E = None
        self.s: D = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: F = None
        self.u: F = None
        self.o: C = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

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

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

b = A("b")
h = B("h")
f = C("f")
l = D("l")
g = E("g")
i = F("i")

b.t = l
b.u = f
h.x = i
h.t = i
h.v = f
h.p = f
h.o = f
h.r = b
f.v = i
f.u = g
f.y = g
f.s = l
f.q = l
l.p = b
l.r = i
l.u = i
l.y = i
l.v = i
l.o = f
g.u = i
g.o = l
g.x = f
g.w = h
i.s = b
i.p = h
i.t = h
i.o = g
assert f.v.t.r.txt == "b"